package com.xxl.job.executor.jobhandler;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import com.xxl.job.executor.service.IInlistService;
import com.xxl.job.executor.service.IStationEnShiftStatisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 入口工班流水统计任务
 * @author 曾智波
 * @since 2020-04-01
 */
@JobHandler(value="StationEnShiftStatisHandler")
@Component
public class StationEnShiftStatisHandler extends IJobHandler {
    @Autowired
    private IInlistService inlistService;

    @Autowired
    private IStationEnShiftStatisService stationEnShiftStatisService;

    @Override
    public ReturnT<String> execute(String param) throws Exception {
//        XxlJobLogger.log("开始执行[入口流水]同步任务");
//        inlistService.transfer();
//        XxlJobLogger.log("完成执行[入口流水]同步任务");

//        XxlJobLogger.log("--------------------------------------");

        XxlJobLogger.log("开始执行[入口工班流水统计]任务");
        stationEnShiftStatisService.syncRecord();//调用同步数据方法
        XxlJobLogger.log("执行[入口工班流水统计]任务结束");
        return SUCCESS;
    }
}
